/**
 * events模块
 */
let EventEmitter = require('events')
// let EventEmitter = require('./events')
let util = require('util')
// console.log(util);

function Bell(){
    EventEmitter.call(this)//继承私有属性
}
// 0 不做限制 
// 进行原型继承  继承公用
// Object.setPrototypeOf(ctor,super.pt)
util.inherits(Bell,EventEmitter)
let bell = new Bell()
// bell.setMaxListeners(1)  
function sI(a,b){
    console.log(`students take ${a} in ${b}`);
}
function tI(){
    console.log('teacher in');
}
function cI(a,b){
    console.log(`mrsss take ${a} in ${b}`);
}
bell.on('sii',sI)
bell.on('sii',tI)
bell.once('sii',cI)
bell.emit('sii','语文','aii')
bell.emit('sii','英语','bi')